<template>
  <a-sub-menu :key="menuInfo.key">
    <template #icon v-if="menuInfo.icon"><MenuIcon :icon="menuInfo.icon" /></template>
    <template #title>{{ menuInfo.title }}</template>
    <template v-for="item in menuInfo.children" :key="item.key">
      <template v-if="!item.children">
        <a-menu-item :key="item.key">
          <template #icon v-if="item.icon">
            <MenuIcon :icon="item.icon"/>
          </template>
          {{ item.title }}
        </a-menu-item>
      </template>
      <template v-else>
        <sub-menu :menu-info="item" :key="item.key" />
      </template>
    </template>
  </a-sub-menu>
</template>
<script setup lang="ts">
import MenuIcon from './MenuIcon.vue';
const props = defineProps({
  menuInfo: {
    type: Object,
    default: () => ({}),
  },
})
</script>
<style lang="less" scoped>

</style>